App.require(function () {
    var app = App.getCurrent();
    app.definePage("strloaderactive", {
        render: function (next) {
            this.data.icon = this.parent.data.option.icon;
            this.data.content = this.parent.data.content;
            if (location.protocol !== "file:") {
                this.fetch("./index.html", function (text) {
                    next(this.renderHTML(text));
                });
            }
            else next(App.staticHtml.loadPopIndexHtml);
        },
        getDomObj: function () {
            this.attachDom(".icon-container", "iconContainer")
                .attachDom(".content", "contentContainer");
        },
        changeContent: function (content) {
            if (content == this.data.content) return;
            this.data.content = content;
            this.domList.contentContainer.innerHTML = content;
        },
        changeOption: function (option) {
            if (option.icon == this.data.icon) return;
            this.data.icon = option.icon;
            if (option.icon) {
                this.innerHTML(this.domList.iconContainer, '<str-icon icon="{{icon}}" width="48" height="48" class="loader-icon"></str-icon>');
            }
            else {
                this.innerHTML(this.domList.iconContainer, '<str-progress type="circle"></str-progress>');
            }
        },
        init: function () {
            if (typeof this.parent.data.bk == "function") this.parent.data.bk(this.parent);
        }
    })
})